
<!-- BEGIN:main -->


<script>

    $(function() {
        $("#txtModifiedDate").datepicker({
            changeMonth: true,
            changeYear: true
        });

        $('input:radio[name="rdoFilePath"]').change(function() {
            if ($(this).is(':checked') && $(this).val() == 'youtube') {
                $("#txtVideo").removeAttr("disabled");
                $("#txtVideo").val('');
                $("#btBrowseVideo").hide();
            }
            else
            {
                $("#txtVideo").attr("disabled", "disabled");
                $("#txtVideo").val('');
                $("#btBrowseVideo").show();
            }
        });
    });



    function submitForm(ac)
    {
        var title = $('#txtTitle');
        var video = $('#txtVideo');

        var arrayInput = new Array(title, video);

        var hasError = validateEmptyValue(arrayInput);

        if (hasError) {
            alert('Vui lòng điền đầy đủ thông tin');
        } else {
            var form = document.phpForm;
            form.hdAction.value = ac;
            form.hdVideo.value = form.txtVideo.value;
            form.hdImage.value = form.txtImage.value;
            form.submit();
        }

    }

    function BrowseImage() {
        var finder = new CKFinder();
        finder.BasePath = '../blugin/ckeditor3.6.4/ckfinder/';
        finder.startupPath = "Images:/images/";
        finder.SelectFunction = SetImageField;
        finder.Popup();
    }


    function BrowseVideo() {
        var finder = new CKFinder();
        finder.BasePath = '../blugin/ckeditor3.6.4/ckfinder/';
        finder.startupPath = "Video:/video/";
        finder.SelectFunction = SetVideoField;
        finder.Popup();
    }

    functionSetImageField(fileUrl)
    {
        document.getElementById('txtImage').value = fileUrl;
    }

    function SetVideoField(fileUrl) {
        document.getElementById('txtVideo').value = fileUrl;
    }



</script>

<!-- BEGIN:hide_browse_button -->
<script language="javascript" type="text/javascript">
    jQuery(document).ready(function($) {
        $("#txtVideo").removeAttr("disabled");
        $("#btBrowseVideo").hide();
    });
</script>
<!-- END:hide_browse_button -->


<div id="toolbar-box">
    <div class="d_divide5"></div>
    <div class="toolbar" id="toolbar">
        <table class="toolbar">
            <tbody>
                <tr>
                    <td class="button" id="toolbar-save">
                        <a href="javascript:void()" onclick="submitForm('editAndExit')" class="toolbar">
                            <span class="icon-32-save" title="Lưu và thoát">
                            </span>
                            Lưu và thoát
                        </a>
                    </td>

                    <td class="button" id="toolbar-apply">
                        <a href="javascript:void()" onclick="submitForm('edit')" class="toolbar">
                            <span class="icon-32-apply" title="Lưu">
                            </span>
                            Lưu
                        </a>
                    </td>

                    <td class="button" id="toolbar-cancel">
                        <a href="./?com=com_video&task=view"  class="toolbar">
                            <span class="icon-32-cancel" title="Hủy">
                            </span>
                            Hủy
                        </a>
                    </td>


                </tr>

            </tbody>
        </table>
    </div>
    <div class="header icon_48_video_edit">
        Video: <small><small>[ Chỉnh sửa ]</small></small><br>
    </div>

    <div class="d_divide5"></div>
</div>





<div class="d_divide10"></div>
<div class="d_clear"></div>

<div id="element-box">


    <form method="post" name="phpForm">


        <fieldset class="adminform">

            <legend>Thông tin video </legend>

            <div class="d_divide2"></div>

            <div>
                <label for="txtTitle" class="d_label">Tiêu đề: <b style="color: red;">*</b></label>
                <input class="d_text_input" name="txtTitle" id="txtTitle" title="tiêu đề đoạn video" type="text" size="50" value="{TITLE}">
            </div>


            <div class="d_divide2"></div>

            <div>
                <label class="d_label">Nguồn file: </label> 

                <!-- BEGIN:on_server -->
                <input name="rdoFilePath" id="rdoFilePath" value="server" class="inputbox" type="radio" checked="checked">
                Trên Server (máy chủ)
                <input name="rdoFilePath" id="rdoFilePath" value="youtube"  class="inputbox" type="radio">
                Trên Youtube                                    
                <!-- END:on_server -->

                <!-- BEGIN:on_youtube -->
                <input name="rdoFilePath" id="rdoFilePath" value="server" class="inputbox" type="radio">
                Trên Server (máy chủ)
                <input name="rdoFilePath" id="rdoFilePath" value="youtube"  class="inputbox" type="radio" checked="checked">
                Trên Youtube
                <!-- END:on_youtube -->

            </div>


            <div class="d_divide2"></div>

            <div>
                <label class="d_label">Video file: <b style="color: red;">*</b></label>
                <input class="d_text_input" style="background: #ffffff;" type="text" id="txtVideo" name="txtVideo" value="{FILE_PATH}" disabled="disabled" size="35" />
                <input id="btBrowseVideo" class="d_button" type="button" onClick="javascript:BrowseVideo();" value="Chọn" />
                <input type="hidden" id="hdVideo" name="hdVideo" value="{FILE_PATH}"/>
            </div>


            <div class="d_divide2"></div>

            <div>
                <label for="txtImage" class="d_label">Ảnh mô tả: </label>
                <input class="d_text_input" style="background: #ffffff;" type="text" id="txtImage" name="txtImage" value="{IMAGE}" disabled="disabled" size="35" />
                <input class="d_button" type="button" onClick="javascript:BrowseImage();" value="Chọn" />
                <input type="hidden" id="hdImage" name="hdImage" value="{IMAGE}"/>

            </div>


            <div class="d_divide2"></div>

            <div>
                <label for="txtModifiedDate" class="d_label">Ngày cập nhật: </label> 
                <input class="d_text_input" class="text_area" name="txtModifiedDate" id="txtModifiedDate" value="{MODIFIED_DATE}" size="15" maxlength="255" title="ngày cập nhật" type="text" readonly="true">
            </div>

            <div class="d_divide2"></div>

            <div>

                <label for="width" class="d_label">Rộng</label>
                <input style="float: left" class="d_text_input" onkeypress="return keypress(event);" type="text" size="10" value="{WIDTH}" name="txtWidth" id="width" > 
                <label for="height" class="d_label" style="width: 105px">Cao: </label>
                <input style="float: left"  class="d_text_input" onkeypress="return keypress(event);" type="text" size="10" value="{HEIGHT}" name="txtHeight" id="height" >
            </div>


            <div class="d_divide2"></div>


            <div>
                <label class="d_label">Bật/Tắt: </label> 

                <!-- BEGIN:status_true -->
                <input name="rdoStatus" id="rdoStatus1" value="0"  type="radio">
                Tắt
                <input name="rdoStatus" id="rdoStatus" value="1" checked="checked" type="radio">
                Bật
                <!-- END:status_true -->


                <!-- BEGIN:status_false -->
                <input name="rdoStatus" id="rdoStatus1" value="0" checked="checked"  type="radio">
                Tắt
                <input name="rdoStatus" id="rdoStatus" value="1"  type="radio">
                Bật                                
                <!-- END:status_false -->
            </div>




            <input type="hidden" id="hdAction" name="hdAction" value="" />
            <input type="hidden" id="hdID" name="hdID" value="{ID}"/>
        </fieldset>


    </form>

</div>
<noscript>
!Cảnh báo! Javascript phải được bật để chạy được các chức năng trong phần Quản trị
</noscript>

<!-- END:main -->